package com.jieshen.lesson1;

import java.awt.*;

public class TestFrame2 {
    public static void main(String[] args) {
        //展示多个窗口 new
        MyFrame myFrame1 = new MyFrame(100, 100, 200, 200, Color.cyan);
        MyFrame myFrame2 = new MyFrame(300, 100, 200, 200, Color.cyan);
        MyFrame myFrame3 = new MyFrame(100, 300, 200, 200, Color.blue);
        MyFrame myFrame4 = new MyFrame(300, 300, 200, 200, Color.cyan);
    }
}

class MyFrame extends Frame{
    // id 窗口计时器
    static int id = 0;
    public MyFrame(int x,int y,int w,int h,Color color){
        super("Myframe+"+(++id));
        setBackground(color);
        setBounds(x,y,w,h);
        setVisible(true);
    }

}